﻿using Cmp.Web.Common;
using Cmp.Web.IRepository;
using Cmp.Web.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cmp.Web.Repository
{
    /// <summary>
    /// 科室数据获取
    /// </summary>
    public class DeptProvide : DbContext<DeptInfo>, IDeptProvide
    {
        public Task<List<DeptInfo>> GetDeptInfoList(out ExceptionAll exception)
        {
            exception = new ExceptionAll();
            try
            {

                return Task.FromResult(Db.Queryable<DeptInfo>().ToList());

            }
            catch (Exception ex)
            {
                exception.errMsg = ex.Message;
                exception.Action = System.Reflection.MethodBase.GetCurrentMethod()!.Name;
                exception.errMsgId = ErrorType.MyInterfaceError;
                exception.Exception = ex;
            }
            return null;
        }
    }
}
